package com.xbongbong.pro.enums;

import com.xbongbong.saas.enums.CreditCardBillTypeEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * DistributorMark枚举
 * @author lee
 * @time 2020-12-22 10:17
 */
@Getter
public enum DistributorMarkEnum {

    /**
     * 经销商标示
     */
    DISTRIBUTOR(1),

    /**
     * 非经销商标示
     */
    OTHER(0),
    ;

    /**
     * 数据库字典值
     */
    private Integer code;


    DistributorMarkEnum(Integer code) {
        this.code = code;
    }

    public static DistributorMarkEnum getByCode(Integer code) {
        for (DistributorMarkEnum cacheCode : values()) {
            if (Objects.equals(code, cacheCode.getCode())) {
                return cacheCode;
            }
        }
        return null;
    }
}
